Image Compression Manager Function Control Flags
A number of Image Compression Manager functions take control flags that allow your application to exert greater control over the operation. In some cases, the Image Compression Manager returns status information about the results of the function in the same flags field. In general, you need to use only a few of these flags. The function descriptions in the reference section of this chapter indicate the flags that are valid for individual functions.
The
CodecFlags
data type defines these flag fields.
typedef unsigned short CodecFlags;
/* Image Compression Manager function control flags */
#define codecFlagUseImageBuffer (1L<<0)
/* (input) use image buffer */
#define codecFlagUseScreenBuffer (1L<<1)
/* (input) use screen buffer */
#define codecFlagUpdatePrevious (1L<<2)
/* (input) update previous buffer */
#define codecFlagNoScreenUpdate (1L<<3)
/* (input) don't update screen */
#define codecFlagWasCompressed (1L<<4)
/*(input) image was compressed */
#define codecFlagDontOffscreen (1L<<5)
/* don't go offscreen */
#define codecFlagUpdatePreviousComp (1L<<6)
/* (input) update previous buffer */
#define codecFlagForceKeyFrame (1L<<7)
/* force key frame from image */
#define codecFlagOnlyScreenUpdate
(1L<<8)
/* (input) only update screen */
#define codecFlagLiveGrab (1L<<9)
/* (input) grab live video */
#define codecFlagUsedNewImageBuffer
(1L<<14)
/* (output) new image buffer used */
#define codecFlagUsedImageBuffer
(1L<<15)
/* (output) decompressor used
offscreen buffer */
Constant descriptions
-
codecFlagUseImageBuffer
-
Controls whether the decompressor allocates an offscreen buffer for decompression. If your application sets this flag to 1, the decompressor allocates an offscreen buffer the size of the compressed image. If you set this flag to 0, the decompressor does not use an offscreen image buffer. These image buffers are useful when decompressing sequences that were created using temporal compression. For more information about image buffers, see
"Using Screen Buffers and Image Buffers"
.
-
codecFlagUseScreenBuffer
-
Controls whether the decompressor allocates an offscreen destination buffer during decompression. If you set this flag to 1, the decompressor allocates an offscreen buffer the size of the destination screen. If you set this flag to 0, the decompressor does not use an offscreen screen buffer. Using a screen buffer helps to reduce tearing that may result when decompressing directly to the screen. For more information about screen buffers, see
"Using Screen Buffers and Image Buffers"
.
-
codecFlagUpdatePrevious
-
Controls whether the compressor updates the previous image buffer during compression. This flag is only used with sequences that are being temporally compressed. If you set this flag to 1, the compressor copies the current source image into the previous frame buffer at the end of the frame compression.
-
codecFlagNoScreenUpdate
-
Controls whether the decompressor updates the screen image. If you set this flag to 1, the decompressor does not write the current frame to the screen, but does write the frame to its offscreen image buffer (if one was allocated). If you set this flag to 0, the decompressor writes the frame to the screen.
-
codecFlagWasCompressed
-
Indicates to the compressor that the image to be compressed has been compressed before. This information may be useful to compressors that can compensate for the image degradation that may otherwise result from repeated compression and decompression of the same image. Set this flag to 1 to indicate that the image was previously compressed. Set this flag to 0 if the image was not previously compressed.
-
codecFlagDontOffscreen
-
Controls whether the decompressor uses the offscreen buffer during sequence decompression. This flag is only used with sequences that have been temporally compressed. If this flag is set to 1, the decompressor does not use the offscreen buffer during decompression. Instead, the decompressor returns an error. This allows your application to refill the offscreen buffer. If this flag is set to 0, the decompressor uses the offscreen buffer if appropriate.
-
codecFlagUpdatePreviousComp
-
Controls whether the compressor updates the previous image buffer with the decompressed image data. This flag is only used with temporal compression and is similar to the
codecFlagUpdatePrevious
flag. As with the
codecFlagUpdatePrevious
flag, if you set this flag to 1, the compressor updates the previous frame buffer at the end of the frame compression. However, this flag causes the Image Compression Manager to update the frame buffer using an image obtained by decompressing the results of the most recent compression operation, rather than the source image.
-
codecFlagForceKeyFrame
-
Controls whether the compressor creates a key frame from the current image. This flag is only used with temporal compression. If you set this flag to 1, the compressor makes the current image a key frame. If you set this flag to 0, the compressor decides based on other criteria, such as the key frame rate, whether to create a key frame from the current image.
-
codecFlagOnlyScreenUpdate
-
Controls whether the decompressor decompresses the current frame. If you set this flag to 1, the decompressor writes the contents of its offscreen image buffer to the screen, but does decompress the current frame. If you set this flag to 0, the decompressor decompresses the current frame and writes it to the screen. You can set this flag to 1 only if you have allocated an offscreen image buffer for use by the decompressor.
-
codecFlagLiveGrab
-
Indicates to the compressor whether the current sequence results from grabbing live video. When working with live video, compressors operate as quickly as possible and disable some additional processing, such as compensation for previously compressed data. Set this flag to 1 when you are compressing from a live video source--the compressor then operates as quickly as it can.
-
codecFlagUsedNewImageBuffer
-
Indicates to your application that the decompressor used the offscreen image buffer for the first time when it processed this frame. If this flag is set to 1, the decompressor used the image buffer for this frame and this is the first time the decompressor used the image buffer in this sequence. If this flag is set to 0, the decompressor did not use the image buffer.
-
codecFlagUsedImageBuffer
-
Indicates to your application that the decompressor used the offscreen image buffer for this frame. If this flag is set to 1, the decompressor used the image buffer. If this flag is set to 0, the decompressor did not use the image buffer.
© 1997 Apple Computer, Inc.Previous | Chapter Top | Chapter Contents | Next